﻿@inject IViewLocalizer Localizer
@using Microsoft.AspNetCore.Mvc.Localization
@model Reborn.IdentityServer4.Admin.STS.Identity.ViewModels.Account.LoginWith2faViewModel
@{
    ViewData["Title"] = Localizer["Title"];
}

@await Html.PartialAsync("_ValidationSummary")

<h2>@ViewData["Title"]</h2>
<hr/>
<p>@Localizer["Info"]</p>
<div class="row">
    <div class="col-md-4">
        <form method="post" asp-route-returnUrl="@Model.ReturnUrl">
            <input asp-for="RememberMe" type="hidden"/>
            <input asp-for="ReturnUrl" type="hidden"/>
            <div class="form-group mb-3">
                <label class="mb-2" asp-for="TwoFactorCode">@Localizer["Code"]</label>
                <input asp-for="TwoFactorCode" class="form-control" autocomplete="off" autofocus/>
                <span asp-validation-for="TwoFactorCode" class="text-danger"></span>
            </div>
            <div class="form-group mb-3">
                <div class="checkbox">
                    <div>
                        @Localizer["Remember"]
                    </div>
                    <toggle-button>
                        <input asp-for="RememberMachine"/>
                    </toggle-button>
                </div>
            </div>
            <div class="form-group mb-3">
                <button type="submit" class="btn btn-primary">@Localizer["LogIn"]</button>
            </div>
        </form>
    </div>
</div>
<p>
    @Localizer["NoAuthenticatorDevice"]
    <a asp-action="LoginWithRecoveryCode" asp-route-returnUrl="@Model.ReturnUrl">@Localizer["LoginWithRecoveryCode"]</a>
</p>